﻿<UserControl x:Class="Ewav.Binomial"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	mc:Ignorable="d"
	d:DesignWidth="640" d:DesignHeight="480"
    DataContext="{Binding Source={StaticResource Locator}, Path=BinomialStatCalcViewModel}"
	xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" 
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk" >
		<UserControl.Resources>
			<Style x:Key="borderStyle" TargetType="Border">
                  <Setter Property="BorderBrush" Value="#FFC4C4C4" />
                  <Setter Property="BorderThickness" Value="1" />
                  <Setter Property="Padding" Value="-1" />
                  <Setter Property="Background" Value="White"/>
            </Style>
		</UserControl.Resources>
		
		<Grid x:Name="LayoutRoot" Background="White" MouseRightButtonDown="LayoutRoot_MouseRightButtonDown"           
		  MouseLeftButtonDown="LayoutRoot_MouseLeftButtonDown">

		<Grid x:Name="GadgetWindow" Background="White" MinWidth="400" MinHeight="30" >
			

			<Rectangle x:Name="GWindow" Style="{StaticResource GWindow}" Grid.RowSpan="2" Stroke="{StaticResource WindowBrush}" StrokeThickness="4" d:LayoutOverrides="GridBox" />
			<StackPanel HorizontalAlignment="Left" VerticalAlignment="Top" Margin="13,11,0,20" Grid.Row="1" d:LayoutOverrides="VerticalAlignment, GridBox">
				<TextBlock x:Name="GName" TextWrapping="Wrap" Text="StatCalc - Binomial" VerticalAlignment="Top" Margin="0,0,26,0" Height="Auto" HorizontalAlignment="Left" Foreground="#FF2B4360" FontSize="21.333"/>

				<Rectangle x:Name="GHeader" VerticalAlignment="Top" Height="4" Margin="0,2,0,0" StrokeThickness="0" Fill="#FF00B050" />	
			</StackPanel>
			<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" d:LayoutOverrides="Height" Margin="0,9,10,20" VerticalAlignment="Top">
				<Button x:Name="ResizeButton" Content="" Template="{StaticResource resizebtn}" Cursor="Hand" Click="ResizeButton_Click" Width="24" Height="24" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
				<Button x:Name="CloseButton" Content="" Template="{StaticResource CloseButton}" Cursor="Hand" Click="CloseGadget_Click" Width="24" Height="24" >
					<Button.Effect>
						<DropShadowEffect Color="#FFB0B0B0" ShadowDepth="1"/>
					</Button.Effect>
				</Button>
			</StackPanel>
			<Grid x:Name="GadgetContentGrid" Grid.Row="1" Height="336" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,47,0,0">


                <StackPanel x:Name="pnlMainContent" Margin="15,10,21,0" VerticalAlignment="Top">
                    
                    <TextBlock TextWrapping="Wrap" HorizontalAlignment="Left" VerticalAlignment="Top" FontSize="18.667"><Run Text="Binomial - Proportion vs. Standard"/></TextBlock>
                    <StackPanel Height="270" Orientation="Horizontal" Margin="0,8,0,0">
                    	<StackPanel HorizontalAlignment="Center" VerticalAlignment="Stretch" Width="246">
                    		<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" Margin="5,15,0,0" HorizontalAlignment="Left" Width="109"><Run Text="Numerator:"/></TextBlock>
                    		<TextBox TextAlignment="Right" Height="30" Width="100" HorizontalAlignment="Right" FontFamily="Microsoft Sans Serif"  FontSize="20" x:Name="txtNumerator" Margin="0,-24,26,0" d:LayoutOverrides="Height" />
                    		<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" Margin="5,15,0,0" HorizontalAlignment="Left" Width="109"><Run Text="Total observations:"/></TextBlock>
                    		<TextBox TextAlignment="Right" Height="30" Width="100" HorizontalAlignment="Right" FontFamily="Microsoft Sans Serif"  FontSize="20" x:Name="txtObserved" Margin="0,-37,26,0" d:LayoutOverrides="Height" />
                    		<TextBlock VerticalAlignment="Center" TextWrapping="Wrap" Margin="5,15,115,0" Width="126" HorizontalAlignment="Left"><Run Text="Expected percentage:"/></TextBlock>
                    		<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Width="103" Height="50" Margin="0,-31,6,0" d:LayoutOverrides="HorizontalAlignment">
                    			<TextBox TextAlignment="Right" Height="30" Width="66" FontFamily="Microsoft Sans Serif" FontSize="20" x:Name="txtExpected" Margin="16,10,-18,10" HorizontalAlignment="Right"/>
                    			<TextBlock VerticalAlignment="Center" FontWeight="Black" HorizontalAlignment="Right" Margin="19,0,0,0"><Run Text=" %"/></TextBlock>
                    		</StackPanel>
                    		<Button Height="35" FontSize="16" FontWeight="Bold" HorizontalAlignment="Left" Margin="90,9,0,0" x:Name="btnGo" VerticalAlignment="Top" Width="130" Click="btnGo_Click" d:LayoutOverrides="GridBox" Style="{StaticResource btnprimary}" >
                    			<StackPanel HorizontalAlignment="Center" Margin="0" VerticalAlignment="Center" Orientation="Horizontal">
                    				<Image Height="16" Source="../../Images/calculator1.png" Stretch="Fill" Width="16" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,2,0"/>
                    				<TextBlock Text="Calculate" Foreground="White" FontWeight="Normal" FontSize="16" HorizontalAlignment="Center" Height="22" VerticalAlignment="Center" Margin="2,0,0,0" />
                    			</StackPanel>                     
                    		</Button>
                    	</StackPanel>
                    	<StackPanel x:Name="valueSP" Margin="2,0,0,0" Orientation="Vertical" HorizontalAlignment="Left" VerticalAlignment="Top">

                    		<Grid x:Name="probabilityGrid" Margin="0,0,0,10" HorizontalAlignment="Center">
			
                    			<Grid.RowDefinitions>
                    				<RowDefinition Height="26"/>
                    				<RowDefinition Height="26"/>
                    				<RowDefinition Height="26"/>
                    				<RowDefinition Height="26"/>
                    				<RowDefinition Height="26"/>
                    				<RowDefinition Height="26"/>
				
                    			</Grid.RowDefinitions>
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="125"/>
                    				<ColumnDefinition Width="125"/>
                    			</Grid.ColumnDefinitions>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Background="#FFD4DEEA" BorderBrush="#FFB7C8DE">
                    				<TextBlock Style="{StaticResource HeaderFont}" Text="Probability that the number of cases is" />
                    			</Border>
  		
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="1" Grid.Column="0" BorderBrush="#FFB7C8DE" BorderThickness="1,0,0,1">
                    				<TextBlock x:Name="lblLessThan" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="1" Grid.Column="1" BorderBrush="#FFB7C8DE" BorderThickness="1,0,1,1">
                    				<!-- Cell 1.1 content here -->
                    				<TextBlock x:Name="txtLessThan" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="2" Grid.Column="0" BorderBrush="#FFB7C8DE" BorderThickness="1,0,0,1">
                    				<TextBlock x:Name="lblLessThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="2" Grid.Column="1" BorderBrush="#FFB7C8DE" BorderThickness="1,0,1,1">
                    				<!-- Cell 2.1 content here -->
                    				<TextBlock x:Name="txtLessThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="3" Grid.Column="0" BorderBrush="#FFB7C8DE" BorderThickness="1,0,0,1">
                    				<TextBlock x:Name="lblEqual" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="3" Grid.Column="1" BorderBrush="#FFB7C8DE" BorderThickness="1,0,1,1">
                    				<!-- Cell 3.1 content here -->
                    				<TextBlock x:Name="txtEqual" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="4" Grid.Column="0" BorderBrush="#FFB7C8DE" BorderThickness="1,0,0,1">
                    				<TextBlock x:Name="lblGreaterThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="4" Grid.Column="1" BorderBrush="#FFB7C8DE" BorderThickness="1,0,1,1">
                    				<!-- Cell 4.1 content here -->
                    				<TextBlock x:Name="txtGreaterThanEqual" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="5" Grid.Column="0" BorderBrush="#FFB7C8DE" BorderThickness="1,0,0,1">
                    				<TextBlock x:Name="lblGreaterThan" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="5" Grid.Column="1" BorderBrush="#FFB7C8DE" BorderThickness="1,0,1,1">
                    				<!-- Cell 5.1 content here -->
                    				<TextBlock x:Name="txtGreaterThan" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"/>
                    			</Border>
  		
                    		</Grid>
                    		<Grid x:Name="twoTailGrid" HorizontalAlignment="Center" Margin="0,0,0,10">
			
                    			<Grid.RowDefinitions>
                    				<RowDefinition Height="26"/>
                    			</Grid.RowDefinitions>
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="125"/>
                    				<ColumnDefinition Width="125"/>
                    			</Grid.ColumnDefinitions>
  		
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="0" Grid.Column="0" Background="#FFD4DEEA" BorderBrush="#FFB7C8DE" BorderThickness="1,1,0,1">
                    				<TextBlock Style="{StaticResource HeaderFont}" Text="Two-tailed p-value" />
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="0" Grid.Column="1" BorderBrush="#FFB7C8DE">
                    				<!-- Cell 1.1 content here -->
                    				<TextBlock x:Name="txtPValue" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"><Run Text=""/></TextBlock>
                    			</Border>
  		
                    		</Grid>
                    		<Grid x:Name="_95CIGrid" HorizontalAlignment="Center">
			
                    			<Grid.RowDefinitions>
                    				<RowDefinition Height="35"/>
				
                    			</Grid.RowDefinitions>
                    			<Grid.ColumnDefinitions>
                    				<ColumnDefinition Width="125"/>
                    				<ColumnDefinition Width="125"/>
                    			</Grid.ColumnDefinitions>
  		
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="0" Grid.Column="0" Background="#FFD4DEEA" BorderBrush="#FFB7C8DE" BorderThickness="1,1,0,1">
                    				<TextBlock Style="{StaticResource HeaderFont}" Text="95% confidence&#xa;interval" />
                    			</Border>
                    			<Border Style="{StaticResource borderStyle}" Grid.Row="0" Grid.Column="1" BorderBrush="#FFB7C8DE">
                    				<!-- Cell 1.1 content here -->
                    				<TextBlock x:Name="txt95Ci" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" FontWeight="Bold"><Run Text="N/A"/></TextBlock>
                    			</Border>
  		
                    		</Grid>
                    	</StackPanel>
                    </StackPanel>
                </StackPanel>

                <Grid x:Name="waitCursor" Background="#36C4C4C4" Height="Auto" Visibility="Collapsed" d:IsLocked="True">
					<toolkit:BusyIndicator x:Name="BusyIndicator" IsBusy="True" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="100" />
				</Grid>
			</Grid>
		</Grid>
	</Grid>
</UserControl>